<%= render 'public/flash_notice' %>
<%= render partial: 'public/errors', locals: { obj: @post } %>


<%= form_for [:cpanel, @post], html: { multipart: true, role: 'form'} do |f| %>
  
  <div class="form-group">

    <%= f.text_field :title, value: @post.title, class: 'form-control',placeholder:"文章标题" %>
  </div>
  <div class="form-group">
    <%= f.text_area :content, value: @post.content, class: 'form-control', id: 'editor' %>
  </div>

  <div class="form-group">
    <%= f.label :language, "语言" %>
    <%= f.select(:language, [['简体中文', 1], ['英文', 2], ['繁体中文', 3]], select: @post.language || 1) %>
  </div>
  <div class="form-group">
    <%= f.label :front_img, "封面" %>
    <%= f.file_field :front_img %>
  </div>

  <%= f.submit '提交', class: 'btn btn-primary'%>
  <%= link_to '返回', cpanel_posts_path, class: 'btn btn-default' %>
<% end %>
